//
//  Color.swift
//  FramerSwift
//
//  Created by ym on 16/3/20.
//  Copyright © 2016年 ym. All rights reserved.
//

import UIKit

let screenW = UIScreen.mainScreen().bounds.width
let screenH = UIScreen.mainScreen().bounds.height

func colorRGBA(r:CGFloat, g:CGFloat, b:CGFloat, a:CGFloat) -> UIColor {
    return UIColor(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: a)
}

func colorHexA(hexString:String, a:CGFloat) -> UIColor {
    let hex = Int(strtoul(hexString, nil, 16))
    return UIColor(red: CGFloat((hex & 0xFF0000) >> 16)/255.0, green: CGFloat((hex & 0xFF00) >> 8)/255.0, blue: CGFloat((hex & 0xFF))/255.0, alpha: a)
}
